import java.awt.image.Kernel;

public class TestDemo {
    //求某一个数的阶乘
    public  static  int fac(int n){
        int ret=1;
        for (int i = 1; i <=n ; i++) {
            ret*=i;
        }
        return  ret;
    }
    //求阶乘的和
    public static int facNum(int k){
        int sum=0;
        for (int i = 0; i <= k; i++) {
            sum+=fac(i);
        }
        return sum;
    }

    public static void main(String[] args) {
        System.out.println(fac(10));
        System.out.println(facNum(10));
    }
}
